# Copyright 2024-2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")

package(
    default_visibility = ["//visibility:public"],
)

cc_library(
    name = "stroke",
    srcs = ["stroke.cc"],
    hdrs = ["stroke.h"],
    deps = [
        "//ink/brush",
        "//ink/brush:brush_coat",
        "//ink/brush:brush_family",
        "//ink/color",
        "//ink/geometry:mutable_mesh",
        "//ink/geometry:partitioned_mesh",
        "//ink/strokes/input:stroke_input_batch",
        "//ink/strokes/internal:stroke_input_modeler",
        "//ink/strokes/internal:stroke_shape_builder",
        "//ink/strokes/internal:stroke_vertex",
        "//ink/types:duration",
        "@com_google_absl//absl/log:absl_check",
        "@com_google_absl//absl/log:absl_log",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/types:span",
    ],
)

cc_test(
    name = "stroke_test",
    srcs = ["stroke_test.cc"],
    deps = [
        ":stroke",
        "//ink/brush",
        "//ink/brush:brush_coat",
        "//ink/brush:brush_family",
        "//ink/brush:brush_paint",
        "//ink/brush:brush_tip",
        "//ink/brush:fuzz_domains",
        "//ink/brush:type_matchers",
        "//ink/color",
        "//ink/geometry:angle",
        "//ink/geometry:envelope",
        "//ink/geometry:mesh_test_helpers",
        "//ink/geometry:partitioned_mesh",
        "//ink/geometry:rect",
        "//ink/geometry:type_matchers",
        "//ink/strokes/input:fuzz_domains",
        "//ink/strokes/input:stroke_input",
        "//ink/strokes/input:stroke_input_batch",
        "//ink/strokes/input:type_matchers",
        "//ink/types:duration",
        "@com_google_absl//absl/log:absl_check",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:span",
        "@com_google_fuzztest//fuzztest",
        "@com_google_fuzztest//fuzztest:fuzztest_gtest_main",
    ],
)

cc_test(
    name = "stroke_benchmark",
    srcs = ["stroke_benchmark.cc"],
    deps = [
        ":stroke",
        "//ink/brush",
        "//ink/brush:brush_behavior",
        "//ink/brush:brush_family",
        "//ink/brush:brush_paint",
        "//ink/brush:brush_tip",
        "//ink/brush:easing_function",
        "//ink/color",
        "//ink/geometry:angle",
        "//ink/geometry:rect",
        "//ink/strokes/input:recorded_test_inputs",
        "//ink/strokes/input:stroke_input_batch",
        "@com_google_absl//absl/log:absl_check",
        "@com_google_absl//absl/status:statusor",
        "@com_google_benchmark//:benchmark_main",
    ],
)

cc_library(
    name = "in_progress_stroke",
    srcs = ["in_progress_stroke.cc"],
    hdrs = ["in_progress_stroke.h"],
    deps = [
        ":stroke",
        "//ink/brush",
        "//ink/brush:brush_coat",
        "//ink/geometry:envelope",
        "//ink/geometry:mesh_format",
        "//ink/geometry:mutable_mesh",
        "//ink/geometry:partitioned_mesh",
        "//ink/strokes/input:stroke_input",
        "//ink/strokes/input:stroke_input_batch",
        "//ink/strokes/input/internal:stroke_input_validation_helpers",
        "//ink/strokes/internal:modeled_stroke_input",
        "//ink/strokes/internal:stroke_input_modeler",
        "//ink/strokes/internal:stroke_shape_builder",
        "//ink/strokes/internal:stroke_shape_update",
        "//ink/strokes/internal:stroke_vertex",
        "//ink/types:duration",
        "@com_google_absl//absl/base:nullability",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/container:inlined_vector",
        "@com_google_absl//absl/log:absl_check",
        "@com_google_absl//absl/log:absl_log",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/types:span",
    ],
)

cc_test(
    name = "in_progress_stroke_test",
    srcs = ["in_progress_stroke_test.cc"],
    deps = [
        ":in_progress_stroke",
        ":stroke",
        "//ink/brush",
        "//ink/brush:brush_family",
        "//ink/brush:brush_paint",
        "//ink/brush:type_matchers",
        "//ink/color",
        "//ink/geometry:angle",
        "//ink/geometry:envelope",
        "//ink/geometry:mesh_format",
        "//ink/geometry:mutable_mesh",
        "//ink/geometry:rect",
        "//ink/geometry:type_matchers",
        "//ink/geometry/internal:algorithms",
        "//ink/strokes/input:stroke_input",
        "//ink/strokes/input:stroke_input_batch",
        "//ink/strokes/input:type_matchers",
        "//ink/types:duration",
        "@com_google_absl//absl/log:absl_check",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:span",
        "@com_google_googletest//:gtest_main",
    ],
)
